package com.daiqile.mysupertab.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.daiqile.mysupertab.R;
import com.daiqile.mysupertab.base.BaseFragment;
import com.daiqile.mysupertab.view.TopBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 */
public class ThreeFragment extends BaseFragment {


    @BindView(R.id.topBar)
    TopBar topBar;
    Unbinder unbinder;

    public ThreeFragment() {
        // Required empty public constructor
    }


    @Override
    public void init() {
        topBar.setOnTopbarClickListener(new TopBar.topbarClickListener() {
            @Override
            public void leftClick() {
                getActivity().finish();
            }

            @Override
            public void rightClick() {

            }
        });
    }

    @Override
    public int getFragmentId() {
        return R.layout.fragment_three;
    }

    @Override
    public Object bindFragment() {
        return this;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
